import Taro from '@tarojs/taro'
import { View, Text } from '@tarojs/components'

import './index.less'

class ListItem extends Taro.Component {
  render() {
    const { label, required, border, children } = this.props

    return (
      <View
        className={[
          'list-item',
          border ? 'border' : ''
        ]}>
        <View>{ required ? <Text>*</Text> : null }{ label }</View>
        { children }
      </View>
    )
  }
}

export default ListItem